package com.qingke.test;

public class MovablePoint implements Move{
	int x;
	int y;
	int xSpeed;
	int ySpeed;
	public MovablePoint(int x,int y,int xSpeed,int ySpeed){
		this.x=x;
		this.y=y;
		this.xSpeed=xSpeed;
		this.ySpeed=ySpeed;
	}
	public String toString(){
		return "Point[x="+x+",y="+y+",xSpeed="+xSpeed+",ySpeed="+ySpeed+"]";
	}
	@Override
	public void moveUp() {
		x+=xSpeed;
	}
	@Override
	public void moveDown() {
		x-=xSpeed;
	}
	@Override
	public void moveLeft() {
		y-=ySpeed;
	}
	@Override
	public void moveRight() {
		y+=ySpeed;
	}
	
}
